apiready = function() {
    seajs.use(['../../V', "../../api", "../../jquery", "../../app", "../../service", "../../dialog"], function(V, $api, $, app, service, dialog) {
        var vm = {
            el: '.container',
            data: {
                sendList: '',
                order_id: '',
                express_id: '',
                express_name: '',
                express_sn: '',
                express_logo: '',
                isSend: '',
            },
            mounted: function() {

            },
            methods: {
                //--确认发货
                shopSendDetailSure: function(et) {
                    this.isSend = false;
                    var unionid = $api.getStorage("shop_unionid"); // 用户id

                    app.ajax(service['orderSendOut'], {
                            data: {
                                values: {
                                    // shop_code: shopId,
                                    unionid: unionid,
                                    order_id: this.order_id,
                                    express_id: this.express_id,
                                    express_sn: this.express_sn,
                                }
                            }
                        },
                        function(res) {
                            if (res.code) {
                                alert("错误代码code：" + res.code + "\n错误信息：" + res.message)
                            } else {
                                api.sendEvent({
                                    name: 'close_win_refresh',
                                    extra: {
                                        shopId: api.pageParam.shopId,
                                    }
                                });

                                console.log(JSON.stringify(res.data))
                                console.log("发货成功!");
                            }
                        });

                },
                //--返回订单
                backOrder: function(et) {
                    api.sendEvent({
                        name: 'close_win_refresh',
                        extra: {
                            shopId: api.pageParam.shopId,
                        }
                    });

                    api.closeFrame();
                },
            },
            created: function() {
                this.isSend = true;
                this.order_id = api.pageParam.order_id;
                this.express_id = api.pageParam.express_id;
                this.express_name = api.pageParam.express_name;
                this.express_sn = api.pageParam.express_sn;
                this.express_logo = api.pageParam.express_logo;

                api.addEventListener({
                    name: 'swiperight'
                }, function(ret, err) {
                    //这里写上你需要关闭的window或是frame
                    api.closeFrame({
                        animation: {
                            type: 'push',
                            subType: "from_left",
                            duration: 300
                        },
                    });

                });
            }
        };

        var even = function() {
            $(".header-btn").on('click', function() {
                api.closeFrame();
            })
        };
        var newVue = new Vue(vm);
        even();

    })
}
